package com.moi.summer;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.widget.TextView;

public class CharacterContentActivity extends Activity {
    public static void actionStart(Context context,String characterName, String characterContent) {
        Intent intent = new Intent(context, CharacterContentActivity.class);
        intent.putExtra("character_name", characterName);
        intent.putExtra("character_content", characterContent);
        context.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.character_content);
        String characterName = getIntent().getStringExtra("character_name");
        String characterConetnt = getIntent().getStringExtra("character_content");
        TextView characterNameTextView = (TextView) findViewById(R.id.character_name);
        characterNameTextView.setText(characterName);
        TextView characterContentTextView = (TextView) findViewById(R.id.character_content);
        characterContentTextView.setText(characterConetnt);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.it_finish:
                finish();
        }
        return true;
    }
}
